﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using SERP.StringMappings;
using SERP.DAO;
using SERP.Controllers;
namespace SERP.Modules.Modules{
	public partial class ModulesInputFields : SERP.Modules.ModuleBase
	{
		protected void Page_Load(object sender, EventArgs e){
			LoadLanguage();
		}
		private ModulesEntity model=new ModulesEntity();
		public ModulesEntity Model{
			set{
				model=value;
			}
			get{
				return model;
			}
		}
		//Load All lable text
		private void LoadLanguage(){
			labelModuleName.Text=ModulesStringMapping.ModuleName+":";
			labelDescription.Text=ModulesStringMapping.Description+":";
			labelIconName.Text=ModulesStringMapping.IconName+":";
			labelModuleLink.Text=ModulesStringMapping.ModuleLink+":";
			labelModuleType.Text=ModulesStringMapping.ModuleType+":";
			validRQModuleType.ErrorMessage=SERP.Constants.APP_REQUIRE_WARNING;	
			validExpressionModuleType.ErrorMessage=SERP.Constants.APP_REQUIRE_INTERGER_WARNING;
		}   
		public void UpdateToModel(){
			model.ModuleName=Convert.ToString(txtModuleName.Text);
			model.Description=Convert.ToString(txtDescription.Text);
			model.IconName=Convert.ToString(txtIconName.Text);
			model.ModuleLink=Convert.ToString(txtModuleLink.Text);
			model.ModuleType=Convert.ToByte(txtModuleType.Text);
		}
		public void UpdateToScreen(){
			txtModuleName.Text=model.ModuleName;
			txtDescription.Text=model.Description;
			txtIconName.Text=model.IconName;
			txtModuleLink.Text=model.ModuleLink;
			txtModuleType.Text=Convert.ToString(model.ModuleType);
		}
		public void ClearScreen(){
			txtModuleName.Text="";
			txtDescription.Text="";
			txtIconName.Text="";
			txtModuleLink.Text="";
			txtModuleType.Text="0";
		}
		public bool ValidateScreen(){
			bool result=true;
			return result;
		}	
	}
}
